xm-test: Scale memory parameter for tests using XenAPIDomain.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Tue, 24 Apr 2007 14:01:13 +0000 (15:01 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Tue, 24 Apr 2007 14:01:13 +0000 (15:01 +0100)
Scale the memory parameter for domains using the XenAPIDomain to
create a domain. Those domains use the normal configuration where the
memory parameter is given in 'Mb', so it needs to be adapted to
'bytes'.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
tools/xm-test/lib/XmTestLib/XenAPIDomain.py

index 024d4a6b1f712e4b77827cdfafcbb7b4bd58a26c..d34d369f0f1e86765bd54a3262f7c9d2afeafb29 100644 (file)
@@ -41,6 +41,8 @@ class XenAPIConfig:
 
     def setOpt(self, name, value):
         """Set an option in the config"""
+        if name == "memory":
+            value <<= 20
         if name in self.opttrlate.keys():
             _name = self.opttrlate[name]
         else: